package iqq.mk.utils;

import java.io.InputStreamReader;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;

public class JavaScriptUtils {
    private static ScriptEngineManager sc;
    private static ScriptEngine engine;
    static{
        sc = new ScriptEngineManager();
    	engine = sc.getEngineByName("JavaScript");
		try {
			engine.eval(new InputStreamReader(JavaScriptUtils.class.getResourceAsStream("JSON.js")));
		} catch (ScriptException e) {}	
    }
	public static ScriptEngine getScriptEngine(){	    
        return engine;
	}
}